import config from '@/config'
import { http } from './../request.ts'

export default {
    config: {
        list: {
            url: `${config.API_URL}/setting/config/list`,
            name: '读取系统配置',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        edit: {
            url: `${config.API_URL}/setting/config/edit`,
            name: '编辑系统配置',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    menu: {
        list: {
            url: `${config.API_URL}/setting/menu/list`,
            name: '菜单列表',
            get: async function () {
                return http.get(this.url)
            }
        },
        edit: {
            url: `${config.API_URL}/setting/menu/edit`,
            name: '编辑菜单',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        del: {
            url: `${config.API_URL}/setting/menu/del`,
            name: '软删菜单',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        sort: {
            url: `${config.API_URL}/setting/menu/sort`,
            name: '排序菜单',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    role: {
        list: {
            url: `${config.API_URL}/setting/role/list`,
            name: '获取角色列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        edit: {
            url: `${config.API_URL}/setting/role/edit`,
            name: '添加角色',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/setting/role/batchDel`,
            name: '批量删除',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        getRoleMenuIds: {
            url: `${config.API_URL}/setting/role/getRoleMenuIds`,
            name: '获取角色权限',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        }
    },
    dept: {
        list: {
            url: `${config.API_URL}/setting/dept/list`,
            name: '获取部门列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        edit: {
            url: `${config.API_URL}/setting/dept/edit`,
            name: '编辑部门',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/setting/dept/batchDel`,
            name: '批量删除部门',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    admin: {
        list: {
            url: `${config.API_URL}/setting/admin/list`,
            name: '获取员工列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        edit: {
            url: `${config.API_URL}/setting/admin/edit`,
            name: '编辑员工',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/setting/admin/batchDel`,
            name: '批量删除员工',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    attachmentCate: {
        list: {
            url: `${config.API_URL}/setting/attachmentCate/list`,
            name: '附件分类列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        add: {
            url: `${config.API_URL}/setting/attachmentCate/add`,
            name: '附件分类新增',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        rename: {
            url: `${config.API_URL}/setting/attachmentCate/rename`,
            name: '附件分类重命名',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        delete: {
            url: `${config.API_URL}/setting/attachmentCate/delete`,
            name: '附件分类删除',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    attachment: {
        list: {
            url: `${config.API_URL}/setting/attachment/list`,
            name: '附件列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        upload: {
            url: `${config.API_URL}/setting/attachment/upload`,
            name: '附件上传',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        move: {
            url: `${config.API_URL}/setting/attachment/move`,
            name: '附件移动',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        rename: {
            url: `${config.API_URL}/setting/attachment/rename`,
            name: '附件重命名',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        delete: {
            url: `${config.API_URL}/setting/attachment/delete`,
            name: '附件删除',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    }
}
